home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / By the Book / Learn C++ (CodeWarrior) / Chap 04.05 - overload / overload.cp < prev    next >
Text File  |  1995-10-20  |  529b  |  33 lines

  1. #include <iostream.h>
  2.  
  3. void    Display( short shortParam );
  4. void    Display( long longParam );
  5. void    Display( char *text );
  6.  
  7. int    main()
  8. {
  9.     short    myShort = 3;
  10.     long    myLong = 12345678L;
  11.     char    *text = "Make it so...";
  12.     
  13.     Display( myShort );
  14.     Display( myLong );
  15.     Display( text );
  16.     
  17.     return 0;
  18. }
  19.  
  20. void    Display( short shortParam )
  21. {
  22.     cout << "The short is: " << shortParam << "\n";
  23. }
  24.  
  25. void    Display( long longParam )
  26. {
  27.     cout << "The long is:  " << longParam << "\n";
  28. }
  29.  
  30. void    Display( char *text )
  31. {
  32.     cout << "The text is:  " << text << "\n";
  33. }